package com.disability_federation.util;

import java.util.Random;

public class RandomUtils {
	/**
	 * 获取随机长度的字符串串
	 */
	private static final String ALL_CHAR_NUM = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	public static String getStringNumRandom(int length) {
		//生成随机数字和字母
		Random random = new Random();
		StringBuilder saltString = new StringBuilder(length);
		for (int i = 1; i <= length; ++i) {
			saltString.append(ALL_CHAR_NUM.charAt(random.nextInt(ALL_CHAR_NUM.length())));
		}
		return saltString.toString();
	}
}